<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <!-- 
            {{key}} 这种插值表达式只能写在标签体中
         -->
        {{msg}} {{1 + 1}} {{hello()}}<br/>
        <span v-html="msg"></span> <br/>
        <span v-text="msg"></span> <br/>

        <!-- 想要改变便签中的属性，就必须得使用 v-bind 来对属性值进行修改 -->
        <!-- class, style {{class名：加上}} -->
         <a v-bind:href="link">gogogo</a> <br/>
         <span v-bind:class="{active:isActive, 'text-danger':isDanger}" 
               v-bind:style="{color: color, 'font-size':size}">你好</span><p>
         
         精通的语言：
         <input type="checkbox" v-model="language" value="Java">Java <br/>
         <input type="checkbox" v-model="language" value="PHP">PHP <br/>
         <input type="checkbox" v-model="language" value="Python">Python <br/>
         选中了 {{language.join(",")}}
    </div>

    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                msg: "<h1>Hello</h1>",
                link: "http://www.baidu.com",
                color: "green",
                size: "22px",
                isActive: true,
                isDanger: true,
                language: []
            },
            methods: {
                hello(){
                    return "World";
                }
            },
        })
    </script>
</body>
</html>